package cn.net.zidian.mvvm.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.blankj.utilcode.util.ActivityUtils;

import cn.net.zidian.databinding.ActivityMainBinding;
import cn.net.zidian.mvvm.activity.AstroActivity;
import cn.net.zidian.mvvm.activity.CiDianActivity;
import cn.net.zidian.mvvm.activity.IPActivity;
import cn.net.zidian.mvvm.activity.IdCardActivity;
import cn.net.zidian.mvvm.activity.ShoujiActivity;
import cn.net.zidian.mvvm.activity.TodayActivity;


public class HomeFragment extends Fragment {

    private ActivityMainBinding viewBinding;


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        viewBinding = ActivityMainBinding.inflate(LayoutInflater.from(requireContext()));
        return viewBinding.getRoot();
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        viewBinding.tvShouji.setOnClickListener(v -> {
            ActivityUtils.startActivity(ShoujiActivity.class);
        });

        viewBinding.tvIp.setOnClickListener(v -> {
            ActivityUtils.startActivity(IPActivity.class);
        });

        viewBinding.tvIdCard.setOnClickListener(v -> {
            ActivityUtils.startActivity(IdCardActivity.class);
        });

        viewBinding.tvXingzuo.setOnClickListener(v -> {
            ActivityUtils.startActivity(AstroActivity.class);
        });

        viewBinding.tvToday.setOnClickListener(v -> {
            ActivityUtils.startActivity(TodayActivity.class);
        });

        viewBinding.tvZidian.setOnClickListener(v -> {
            ActivityUtils.startActivity(CiDianActivity.class);
        });
    }


}
